<?php if (!defined('THINK_PATH')) exit(); require_once "./sample/php/jssdk.php"; $jssdk = new JSSDK("wx73f8f21829bef9c6", "00ea7e3072f302d457e88b7402dc6429"); $signPackage = $jssdk->GetSignPackage(); ?>
<!DOCTYPE html>
<html>
	<head> 
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
		<title><?php echo C('WEB_SITE_TITLE');?></title>
		<link rel="stylesheet" href="/Public/Home/css/swiper-3.3.1.min.css">
		<script src="/Public/Home/js/swiper-3.3.1.min.js"></script>
		
		<link rel="stylesheet" href="/Public/Home/css/common.css">
		<link rel="stylesheet" href="/Public/Home/css/main.css">
		<script src="/Public/Home/js/zepto.js"></script>
		<script src="/Public/Home/js/iscroll-probe.js"></script>
		<script src="/Public/Home/js/delIOS_huitan.js"></script>
		<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
		<!-- <?php
require_once "./sample/php/jssdk.php"; $jssdk = new JSSDK("wx73f8f21829bef9c6", "00ea7e3072f302d457e88b7402dc6429"); $signPackage = $jssdk->GetSignPackage(); ?>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
	wx.config({
			      debug: false,
			      appId: '<?php echo $signPackage["appId"];?>',
			      timestamp: <?php echo $signPackage["timestamp"];?>,
			      nonceStr: '<?php echo $signPackage["nonceStr"];?>',
			      signature: '<?php echo $signPackage["signature"];?>',
			      jsApiList: [
			        'checkJsApi',
			        'onMenuShareTimeline',
			        'onMenuShareAppMessage',
			        'onMenuShareQQ',
			        'onMenuShareWeibo',
			        'onMenuShareQZone',
			      ]
			  });
			
		wx.ready(function(){
			var weiurl = "<?php echo ($weiurl); ?>";
			var weilink = window.location.href;
			var weititle = "<?php echo C('WEB_SITE_TITLE');?>";
			var imgurl = "http://www.miguaner.cn/Public/share/img/chanmaologo.png";
			console.log(weiurl);
	        wx.checkJsApi({
	            jsApiList: ['onMenuShareAppMessage'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
	        });
	         wx.onMenuShareTimeline({
	            title: weititle, 
	            link: weiurl,
	            imgUrl: imgurl, // 分享图标
	            trigger:function(res){
	            },
	            success: function () {
	                //alert('已分享');
	            },
	            cancel: function () {
	            },
	            fail:function(){
	            } 
	        });
	        wx.onMenuShareAppMessage({
	            title: weititle, // 分享标题
	            desc: weilink, // 分享描述
	            link: weiurl, // 分享链接
	            imgUrl: imgurl, // 分享图标
	            type: 'link', // 分享类型,music、video或link，不填默认为link
	            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
	            success: function () {
	              //  alert('hello');
	            },
	            cancel: function () {
	            }
	        });
	         //分享到QQ
	        wx.onMenuShareQQ({
	            title: weititle,
	            desc: weilink,
	            link: weiurl,
	            imgUrl: imgurl, // 分享图标
	            success: function () { 
	               // 用户确认分享后执行的回调函数
	            },
	            cancel: function () { 
	               // 用户取消分享后执行的回调函数
	            }
	        });
	        //分享到腾讯微博
	        wx.onMenuShareWeibo({
	            title: weititle,
	            desc: weilink,
	            link: weiurl,
	            imgUrl: imgurl, // 分享图标
	            success: function () { 
	               // 用户确认分享后执行的回调函数
	            },
	            cancel: function () { 
	                // 用户取消分享后执行的回调函数
	            }
	        });

	        // 分享到qq空间
	        wx.onMenuShareQZone({
			    title: weititle, // 分享标题
			    desc: weilink, // 分享描述
			    link: weiurl, // 分享链接
			    imgUrl: imgurl, // 分享图标
			    success: function () { 
			       // 用户确认分享后执行的回调函数
			    },
			    cancel: function () { 
			        // 用户取消分享后执行的回调函数
			    }
			});
    	});
</script>
 -->
		<style>
			/*下拉加载样式*/
			.loadBin,.loadBinPj{color: #5d5d5d;text-align: center;line-height: 30px;}
			/*#proDetailMain .one,#proDetailMain .two,#proDetailMain .three,#proDetailMain .four{position: absolute;z-index: 1;top: 0;bottom: 0;left: 0;width: 100%;overflow: hidden;}*/
			#proDetailMain .two,#proDetailMain .three{padding: 0;}
			#proDetailMain .two > div,#proDetailMain .three > div{padding: 12px;}
			#proDetailMain .four .main .pjone,#proDetailMain .four .main .pjtwo,#proDetailMain .four .main .pjthree{position: absolute;z-index: 1;top: 0;bottom: 0;left: 0;width: 100%;overflow: hidden;}
		</style>
		<script>
			//用于：拖动切换tab
			// var myScrollone,myScrolltwo,myScrollthree;
			// var loadBin;
			// var isloadone=false,isloadtwo=false,isloadthree=false;
			// var currPage=0;//当前tab在第一个上 第一个0 第二个1 第三个2 第四个3

			//用于：拖动下拉加载 评价
			var myScrollpjone,myScrollpjtwo,myScrollpjthree;
			var loadBinpj;
			var isloadPjone=false,isloadPjtwo=false,isloadPjthree=false;
			var pjonePage=2,pjtwoPage=2,pjthreePage=2;
			var currPagePj=0;//当前评价在第一个上 第一个0

			function onload () {
				// loadBin = document.querySelectorAll(".loadBin");
				loadBinPj=document.querySelectorAll(".loadBinPj");

				// if(currPage==0){
				// 	myScrollone = new IScroll('#proDetailMain .one',{probeType: 3,click:true});
				// 	myScrollone.on("scroll",scrollFun1);
				// 	myScrollone.on("scrollEnd",scrollEndFun1);
				// }
				// else if(currPage==1){
				// 	myScrolltwo = new IScroll('#proDetailMain .two',{probeType: 3,click:true});
				// 	myScrolltwo.on("scroll",scrollFun2);
				// 	myScrolltwo.on("scrollEnd",scrollEndFun2);
				// }
				// else if(currPage==2){
				// 	myScrollthree = new IScroll('#proDetailMain .three',{probeType: 3,click:true});
				// 	myScrollthree.on("scroll",scrollFun3);
				// 	myScrollthree.on("scrollEnd",scrollEndFun3);
				// }
				// //评价
				// else if(currPage==3){
					if(currPagePj==0){
						myScrollpjone = new IScroll('#proDetailMain .four .main .pjone',{probeType: 3,click:true});
						myScrollpjone.on("scroll",scrollFunPj1);
						myScrollpjone.on("scrollEnd",scrollEndFunPj1);
					}
					else if(currPagePj==1){
						myScrollpjtwo = new IScroll('#proDetailMain .four .main .pjtwo',{probeType: 3,click:true});
						myScrollpjtwo.on("scroll",scrollFunPj2);
						myScrollpjtwo.on("scrollEnd",scrollEndFunPj2);
					}
					else if(currPagePj==2){
						myScrollpjthree = new IScroll('#proDetailMain .four .main .pjthree',{probeType: 3,click:true});
						myScrollpjthree.on("scroll",scrollFunPj3);
						myScrollpjthree.on("scrollEnd",scrollEndFunPj3);
					}
				// }
			}
			// var scrollFun1=function(){
			// 	if((this.y - this.maxScrollY)>>0 < -50){
			// 		isloadone = true;
			// 		loadBin[0].innerHTML = "继续拖动，查看图文详情";
			// 		myScrollone.refresh();
			// 		myScrollone.off("scroll",scrollFun1);
			// 	}
			// }
			// var scrollEndFun1=function(){
			// 	if(isloadone){
			// 		isloadone = false;

			// 		//跳转到tab2 图文详情
			// 		currPage=1;
			// 		$('#proDetailMain .contain > div').eq(currPage).css('display','block').siblings().css('display','none');
			// 		$('#proDetailTop .top2 li').eq(currPage).addClass('active').siblings().removeClass('active');
			// 		onload();

			// 		loadBin[0].innerHTML = "";
			// 		myScrollone.on("scroll",scrollFun1);
			// 		myScrollone.refresh();
			// 	}
			// }
			
			// var scrollFun2=function(){
			// 	if((this.y - this.maxScrollY)>>0 < -50){
			// 		isloadtwo = true;
			// 		loadBin[1].innerHTML = "继续拖动，查看产品参数";
			// 		myScrolltwo.refresh();
			// 		myScrolltwo.off("scroll",scrollFun2);
			// 	}
			// }
			// var scrollEndFun2=function(){
			// 	if(isloadtwo){
			// 		isloadtwo = false;

			// 		//跳转到tab3 产品参数
			// 		currPage=2;
			// 		$('#proDetailMain .contain > div').eq(currPage).css('display','block').siblings().css('display','none');
			// 		$('#proDetailTop .top2 li').eq(currPage).addClass('active').siblings().removeClass('active');
			// 		onload();

			// 		loadBin[1].innerHTML = "";
			// 		myScrolltwo.on("scroll",scrollFun2);
			// 		myScrolltwo.refresh();
			// 	}
			// }

			// var scrollFun3=function(){
			// 	if((this.y - this.maxScrollY)>>0 < -50){
			// 		isloadthree = true;
			// 		loadBin[2].innerHTML = "继续拖动，查看评价";
			// 		myScrollthree.refresh();
			// 		myScrollthree.off("scroll",scrollFun3);
			// 	}
			// }
			// var scrollEndFun3=function(){
			// 	if(isloadthree){
			// 		isloadthree = false;

			// 		//跳转到tab4 产品参数
			// 		currPage=3;
			// 		$('#proDetailMain .contain > div').eq(currPage).css('display','block').siblings().css('display','none');
			// 		$('#proDetailTop .top2 li').eq(currPage).addClass('active').siblings().removeClass('active');
			// 		onload();

			// 		loadBin[2].innerHTML = "";
			// 		myScrollthree.on("scroll",scrollFun3);
			// 		myScrollthree.refresh();
			// 	}
			// }

			//评价
			var scrollFunPj1=function(){
				if((this.y - this.maxScrollY)>>0 < -50){
					isloadPjone = true;
					loadBinPj[0].innerHTML = "松开手指加载更多";
					myScrollpjone.refresh();
					myScrollpjone.off("scroll",scrollFunPj1);
				}
			}
			//all评价下拉加载
			var scrollEndFunPj1=function(){
				if(isloadPjone){
					isloadPjone = false;
					var proid = <?php echo ($info["id"]); ?>;
					 $.ajax({
					 	type: 'GET',
					 	url: "<?php echo U('Product/ajaxGetEvaluate');?>",
					 	data:{page:pjonePage,proid:proid,state:0},
					 	dataType: 'json',
					 	success: function(data){
					 		console.log(data);
					 		if(data.length>0){
					 			pjonePage++;
					 			//列表
								var str='';
								for(var i=0;i<data.length;i++){
									str+='<li>\
											<div class="title clear">';
												if(data[i].image!=""){
													str+='<p class="touxiang" style="background-image: url('+data[i].image+')"></p>';
												}else{
													str+='<p class="touxiang" style="background-image: url(/Public/Home/img/mytouxiang.png)"></p>';
												}
												str+='<span class="phone">'+data[i].name+'</span><span class="time">'+data[i].time+'</span>';
											str+='</div>\
											<div class="content">\
												<p class="hua">';
													for(var j=0;j<data[i].score;j++){
														str+='<span class="hz huaorange">&#xe614;</span>';
													}
													for(var k=0;k<5-data[i].score;k++){
														str+='<span class="hz huagray">&#xe614;</span>';
													}
													str+='<span class="zhi">'+data[i].score+'.0</span>\
												</p>\
												<p class="word">全部评价</p>\
											</div>\
										</li>';
								}
								$('#proDetailMain .four .main .pjone ul').append(str);
					 			
					 		}else{
					 			//没有更多数据了
								$('.noDataPingjiaAll').show();
								scrollFunPj1=function(){
									isloadPjone = true;
									myScrollpjone.refresh();
									myScrollpjone.off("scroll",scrollFunPj1);
								}
					 		}
							
							myScrollpjone.refresh();
							telCenterStar('#proDetailMain .pingjia .main .pingjiaCom .title .phone');

							
					 	},
					 	error: function(xhr, type){
					 		console.log('Ajax error!');
					 	}
					 });

					loadBinPj[0].innerHTML = "";
					myScrollpjone.on("scroll",scrollFunPj1);
					myScrollpjone.refresh();
				}
			}

			var scrollFunPj2=function(){
				if((this.y - this.maxScrollY)>>0 < -50){
					isloadPjtwo = true;
					loadBinPj[1].innerHTML = "松开手指加载更多";
					myScrollpjtwo.refresh();
					myScrollpjtwo.off("scroll",scrollFunPj2);
				}
			}
			//好评下拉加载
			var scrollEndFunPj2=function(){
				if(isloadPjtwo){
					isloadPjtwo = false;
					var proid=<?php echo ($info["id"]); ?>;
					 $.ajax({
					 	type: 'GET',
					 	url: "<?php echo U('Product/ajaxGetEvaluate');?>",
					 	data:{page:pjtwoPage,proid:proid,state:1},
					 	dataType: 'json',
					 	success: function(data){
					 		if(data.length>0){
					 			pjtwoPage++;
								//列表
								var str='';
								for(var i=0;i<data.length;i++){
									str+='<li>\
											<div class="title clear">';
												if(data[i].image!=""){
													str+='<p class="touxiang" style="background-image: url('+data[i].image+')"></p>';
												}else{
													str+='<p class="touxiang" style="background-image: url(/Public/Home/img/mytouxiang.png)"></p>';
												}
												str+='<span class="phone">'+data[i].name+'</span><span class="time">'+data[i].time+'</span>';
											str+='</div>\
											<div class="content">\
												<p class="hua">';
													for(var j=0;j<data[i].score;j++){
														str+='<span class="hz huaorange">&#xe614;</span>';
													}
													for(var k=0;k<5-data[i].score;k++){
														str+='<span class="hz huagray">&#xe614;</span>';
													}
													str+='<span class="zhi">'+data[i].score+'.0</span>\
												</p>\
												<p class="word">好评</p>\
											</div>\
										</li>';
								}
								$('#proDetailMain .four .main .pjtwo ul').append(str);
					 			
					 		}else{
					 			//没有更多数据了
								$('.noDataPingjiaAll').show();
								scrollFunPj1=function(){
									isloadPjtwo = true;
									myScrollpjtwo.refresh();
									myScrollpjtwo.off("scroll",scrollFunPj2);
								}
					 		}
							
							myScrollpjtwo.refresh();
							telCenterStar('#proDetailMain .pingjia .main .pingjiaCom .title .phone');
							
					 	},
					 	error: function(xhr, type){
					 		console.log('Ajax error!');
					 	}
					 });

					loadBinPj[1].innerHTML = "";
					myScrollpjtwo.on("scroll",scrollFunPj2);
					myScrollpjtwo.refresh();
				}
			}

			var scrollFunPj3=function(){
				if((this.y - this.maxScrollY)>>0 < -50){
					isloadPjthree = true;
					loadBinPj[2].innerHTML = "松开手指加载更多";
					myScrollpjthree.refresh();
					myScrollpjthree.off("scroll",scrollFunPj3);
				}
			}
			//差评下拉加载
			var scrollEndFunPj3=function(){
				if(isloadPjthree){
					isloadPjthree = false;
					var proid=<?php echo ($info["id"]); ?>;
					 $.ajax({
						type: 'GET',
					 	url: "<?php echo U('Product/ajaxGetEvaluate');?>",
					 	dataType: 'json',
					 	data:{page:pjthreePage,proid:proid,state:2},
					 	success: function(data){
					 		if(data.length>0){
					 			pjthreePage++;
								//列表
								var str='';
								for(var i=0;i<data.length;i++){
									str+='<li>\
											<div class="title clear">';
												if(data[i].image!=""){
													str+='<p class="touxiang" style="background-image: url('+data[i].image+')"></p>';
												}else{
													str+='<p class="touxiang" style="background-image: url(/Public/Home/img/mytouxiang.png)"></p>';
												}
												str+='<span class="phone">'+data[i].name+'</span><span class="time">'+data[i].time+'</span>';
											str+='</div>\
											<div class="content">\
												<p class="hua">';
												for(var j=0;j<data[i].score;j++){
													str+='<span class="hz huaorange">&#xe614;</span>';
												}
												for(var k=0;k<5-data[i].score;k++){
													str+='<span class="hz huagray">&#xe614;</span>';
												}
												str+='<span class="zhi">5.0</span>\
												</p>\
												<p class="word">差评</p>\
											</div>\
										</li>';
								}
								$('#proDetailMain .four .main .pjthree ul').append(str);
								
					 		}else{
					 			//没有更多数据了
								$('.noDataPingjiaAll').show();
								scrollFunPj1=function(){
									isloadPjthree = true;
									myScrollpjthree.refresh();
									myScrollpjthree.off("scroll",scrollFunPj3);
								}
					 		}

							myScrollpjthree.refresh();
							telCenterStar('#proDetailMain .pingjia .main .pingjiaCom .title .phone');
					 	},
					 	error: function(xhr, type){
					 		console.log('Ajax error!');
					 	}
					 });

					loadBinPj[2].innerHTML = "";
					myScrollpjthree.on("scroll",scrollFunPj3);
					myScrollpjthree.refresh();
				}
			}
		</script>
	</head>
	<body onLoad="onload()" class="box">
		<!-- 分享提示 -->
		<div id="share" style="display:none"><img src="/Public/Home/img/share.png"></div>
		<!--收藏成功提示-->
		<div id="shoucangokTip" class="scTip" style="opacity: 0">
			<p><span class="hz">&#xe613;</span></p>
			收藏成功
		</div>
		<!--取消收藏成功提示-->
		<div id="shoucangxTip" class="scTip" style="opacity: 0">
			<p><span class="hz">&#xe613;</span></p>
			取消收藏成功
		</div>
		<!-- 颜色规格 -->
		<div id="proDetailGuige" style="display:none;">
			<div class="top">
				<div class="imgContain">
					<p class="img" style="background-image:url(<?php echo ($info["image"]); ?>)"></p>
				</div>
				<div class="centerArea">
					<div class="title"><?php echo ($info["title"]); ?></div>
					<div class="price">
						<span id='gprice_txt'>&yen;<?php echo ($info["gprice"]); ?></span><del>&yen;<?php echo ($info["market_price"]); ?></del>
					</div>
				</div>
				<span class="hz close">&#xe617;</span>
			</div>
			<div class="scrollArea">
				<div class="num">
					<p class="title">数量</p>
					<div class="addJianCom">
						<a href="javascript:;" class="hz jian nooperate">&#xe616;</a>
						<input type="number" value="1" id='amount'>
						<a href="javascript:;" class="hz add canoperate">&#xe615;</a>
					</div>
				</div>
			</div>
		</div>
		<!--正文区域-->
		<div id="proDetailTop">
			<div class="contain maxWidth">
				<div class="top1">
					<a href="javascript:;" class="hz back">&#xe600;</a>
					<a href="<?php echo U('Cart/index');?>" class="right carta">
						<span class="hz cart">&#xe601;</span>
						<em><?php echo ($cart_num); ?></em>
					</a>
					<a href="javascript:;" class="right shoucanga">
					<span class="hz shoucang" style="display: <?php if($is_coll == 0): ?>block<?php else: ?>none<?php endif; ?>">&#xe60f;</span>
					<span class="hz shoucangok" style="display: <?php if($is_coll == 1): ?>block<?php else: ?>none<?php endif; ?>">&#xe612;</span></a>

					<a href="javascript:;" class="right sharea"><span class="hz share">&#xe60e;</span></a>
				</div>
				<div class="top2">
					<ul class="clear">
						<li class="active"><a href="javascript:;">基本信息</a></li>
						<li><a href="javascript:;">图文详情</a></li>
						<li><a href="javascript:;">产品参数</a></li>
						<li><a href="javascript:;">评价</a></li>
					</ul>
				</div>
			</div>
		</div>
		<div id="proDetailMain" class="fastscroll">
			<div class="contain maxWidth">
				<!--基本信息-->
				<div class="one item basicInfo">
					<div class="maxWidth">
						<div class="swiper-container lunbo">
							<div class="swiper-wrapper">
							<?php if(is_array($piclist)): $i = 0; $__LIST__ = $piclist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?><div class="swiper-slide">
									<img src="<?php echo ($item["path"]); ?>"/>
								</div><?php endforeach; endif; else: echo "" ;endif; ?>
							</div>
							<div class="swiper-pagination"></div>
						</div>
						<div class="infoContent">
							<div class="basic">
								<p class="title">
									<?php echo ($info["title"]); ?>
								</p>
								<p class="price">
									<span>&yen;<?php echo ($info["gprice"]); ?></span><del>&yen;<?php echo ($info["market_price"]); ?></del>
								</p>
								<p class="other">
									快递费:&yen;<span class="kuaidi"><?php echo ($info["express_money"]); ?></span>已售:<span class="num"><?php echo ($info["sell_num"]); ?></span>件
								</p>
							</div>
							<div class="guize">
								<!-- <a href="<?php echo U('Product/newsdetail',array('id'=>7));?>">
									<span class="fan">返</span>返利规则
									<span class="hz">&#xe60c;</span>
								</a> -->
								<a href="<?php echo U('Product/newsdetail',array('id'=>8));?>">
									<span class="tui">推</span>分享规则
									<span class="hz">&#xe60c;</span>
								</a>
							</div>
							<div class="select">
								<a href="javascript:;">
									<span class="selectno">请选择商品规格</span>
									<span class="selected" style="display:none">
										已选： <span class="selectinfo"></span><span class="num">1</span>件
									</span>
									<span class="hz">&#xe60c;</span>
								</a>
							</div>
						</div>
						<div class="loadBin"></div>
					</div>
				</div>
				<!--图文详情 这个区域的p h1 h2 h3 h4 h5 h6 em i strong b ins del a的样式已经定义过了-->
				<div class="two item tuwenDetail" style="display: none">
					<div class="maxWidth">
						<div class="imgs">
							<?php echo ($info["content"]); ?>
						</div>
						<div class="loadBin"></div>
					</div>
				</div>
				<!--产品参数-->
				<div class="three item proCanshu" style="display:none;">
					<div class="maxWidth">
						<div class="con">
							<?php echo htmlspecialchars_decode($info['description']); ?>
							<?php ?><!-- {htmlspecialchars_decode($info['description'])} -->
						</div>
						<div class="loadBin"></div>
					</div>
				</div>
				<!--评价-->
				<div class="four item pingjia" style="display:none;">
					<div class="top">
						<ul class="clear">
							<li class="active"><p><a href="javascript:;">全部(<span class="all"><?php echo ($evaluate_num); ?></span>)</a></p></li>
							<li><p><a href="javascript:;">好评(<span class="good"><?php echo count($hao_evaluate_list);?></span>)</a></p></li>
							<li><p><a href="javascript:;">差评(<span class="bad"><?php echo count($cha_evaluate_list);?></span>)</a></p></li>
						</ul>
					</div>
					<div class="main">
						<div class="contain maxWidth">
							<div class="pjone allPingjia pingjiaCom">
								<div class="maxWidth">
									<div class="summary clear">
										<div class="left">
											<p class="sumzhi"><?php echo ($total_score); ?>.0</p>
											<span>整体评价</span>
										</div>
										<div class="right">
											<?php $__FOR_START_21876__=0;$__FOR_END_21876__=$total_score;for($i=$__FOR_START_21876__;$i < $__FOR_END_21876__;$i+=1){ ?><span class="hz huaorange">&#xe614;</span><?php } ?>
											<?php $__FOR_START_27293__=0;$__FOR_END_27293__=5-$total_score;for($i=$__FOR_START_27293__;$i < $__FOR_END_27293__;$i+=1){ ?><span class="hz huagray">&#xe614;</span><?php } ?>
										</div>
									</div>
									<ul class="marok">
										<?php if(is_array($all_evaluate_list)): $i = 0; $__LIST__ = $all_evaluate_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?><li>
											<div class="title clear">
												<?php if($userarr[$item['user_id']]['image'] != ''): ?><p class="touxiang" style="background-image: url(<?php echo ($userarr[$item['user_id']]['image']); ?>)"></p>
												<?php else: ?>
												<p class="touxiang" style="background-image: url(/Public/Home/img/mytouxiang.png)"></p><?php endif; ?>
												<span class="phone"><?php echo ($userarr[$item['user_id']]['login_user']); ?></span>
												<span class="time"><?php echo date('Y-m-d',$item['addtime']);?></span>
											</div>
											<div class="content">
												<p class="hua">
												<?php $__FOR_START_16058__=0;$__FOR_END_16058__=$item['score'];for($i=$__FOR_START_16058__;$i < $__FOR_END_16058__;$i+=1){ ?><span class="hz huaorange">&#xe614;</span><?php } ?>
												<?php $__FOR_START_4459__=0;$__FOR_END_4459__=5-$item['score'];for($i=$__FOR_START_4459__;$i < $__FOR_END_4459__;$i+=1){ ?><span class="hz huagray">&#xe614;</span><?php } ?>
													<span class="zhi"><?php echo ($item["score"]); ?>.0</span>
												</p>
												<p class="word"><?php echo ($item["desc"]); ?></p>
											</div>
										</li><?php endforeach; endif; else: echo "" ;endif; ?>
									</ul>
									<div class="noData noDataPingjiaAll" style="display:none">没有更多评价了</div>
									<div class="loadBinPj"></div>
								</div>
							</div>
							<div style="display: none" class="pjtwo goodPingjia pingjiaCom">
								<div class="maxWidth">
									<ul class="marok">
										
										<?php if(is_array($hao_evaluate_list)): $i = 0; $__LIST__ = $hao_evaluate_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?><li>
											<div class="title clear">
												<?php if($userarr[$item['user_id']]['image'] != ''): ?><p class="touxiang" style="background-image: url(<?php echo ($userarr[$item['user_id']]['image']); ?>)"></p>
												<?php else: ?>
												<p class="touxiang" style="background-image: url(/Public/Home/img/mytouxiang.png)"></p><?php endif; ?>
												<span class="phone"><?php echo ($userarr[$item['user_id']]['login_user']); ?></span>
												<span class="time"><?php echo date('Y-m-d',$item['addtime']);?></span>
											</div>
											<div class="content">
												<p class="hua">
												<?php $__FOR_START_13512__=0;$__FOR_END_13512__=$item['score'];for($i=$__FOR_START_13512__;$i < $__FOR_END_13512__;$i+=1){ ?><span class="hz huaorange">&#xe614;</span><?php } ?>
												<?php $__FOR_START_6497__=0;$__FOR_END_6497__=5-$item['score'];for($i=$__FOR_START_6497__;$i < $__FOR_END_6497__;$i+=1){ ?><span class="hz huagray">&#xe614;</span><?php } ?>
													<span class="zhi"><?php echo ($item["score"]); ?>.0</span>
												</p>
												<p class="word"><?php echo ($item["desc"]); ?></p>
											</div>
										</li><?php endforeach; endif; else: echo "" ;endif; ?>
									</ul>
									<div class="noData noDataPingjiaAll" style="display:none">没有更多评价了</div>
									<div class="loadBinPj"></div>
								</div>
							</div>
							<div style="display: none" class="pjthree chaPingjia pingjiaCom">
								<div class="maxWidth">
									<ul class="marok">
									<?php if(is_array($cha_evaluate_list)): $i = 0; $__LIST__ = $cha_evaluate_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?><li>
											<div class="title clear">
												<?php if($userarr[$item['user_id']]['image'] != ''): ?><p class="touxiang" style="background-image: url(<?php echo ($userarr[$item['user_id']]['image']); ?>)"></p>
												<?php else: ?>
												<p class="touxiang" style="background-image: url(/Public/Home/img/mytouxiang.png)"></p><?php endif; ?>
												<span class="phone"><?php echo ($userarr[$item['user_id']]['login_user']); ?></span>
												<span class="time"><?php echo date('Y-m-d',$item['addtime']);?></span>
											</div>
											<div class="content">
												<p class="hua">
												<?php $__FOR_START_3206__=0;$__FOR_END_3206__=$item['score'];for($i=$__FOR_START_3206__;$i < $__FOR_END_3206__;$i+=1){ ?><span class="hz huaorange">&#xe614;</span><?php } ?>
												<?php $__FOR_START_22855__=0;$__FOR_END_22855__=5-$item['score'];for($i=$__FOR_START_22855__;$i < $__FOR_END_22855__;$i+=1){ ?><span class="hz huagray">&#xe614;</span><?php } ?>
													<span class="zhi"><?php echo ($item["score"]); ?>.0</span>
												</p>
												<p class="word"><?php echo ($item["desc"]); ?></p>
											</div>
										</li><?php endforeach; endif; else: echo "" ;endif; ?>
									</ul>
									<div class="noData noDataPingjiaAll" style="display:none">没有更多评价了</div>
									<div class="loadBinPj"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="proDetailBot">
			<div class="contain maxWidth">
				<button class="cart">加入购物车</button><button class="mai">立即购买</button>
			</div>
		</div>
		<!--confirm-->
		<div class="confirm" style="display: none">
			<div class="top">确认收货吗</div>
			<div class="bot clear">
				<div class="l"><p>取消</p></div>
				<div class="r"><p>确定</p></div>
			</div>
		</div>
		<!-- 遮罩-->
		<div id="zhezhao" style="display: none"></div>
		<!--提示文字-->
		<div class="tip" style="opacity: 0;z-index: -1"></div>

<input type="hidden" id="sel_attr" name="sel_attr" class="kind_selected" value="" />
		<script>
			var share_user_id=<?php echo ($share_user_id); ?>;
			var is_login=<?php echo ($is_login); ?>;
			var stra="";
			var product_id=<?php echo ($info["id"]); ?>;
			function ergodic()
			{
				stra='';
				$(".fenlei .content .select").each(function(index, element) {
					var ssele=$(this).html();
					stra+=ssele
				});
				$('#sel_attr').val(stra);

			}
			// $('.fenlei .content p').click(function(){
				// ergodic();
				// getpriceattr();
			// })
			// function getpriceattr()
			// {
			// 	$.ajax({
			// 		//提交数据的类型 POST GET
			// 		type:"POST",
			// 		//提交的网址
			// 		url:"/Product/getpriceattr",
			// 		//提交的数据
			// 		data:{'attr':$('#sel_attr').val(),'product_id':product_id},
			// 		//返回数据的格式
			// 		datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
			// 		//在请求之前调用的函数
			// 		//成功返回之后调用的函数             
			// 		success:function(json){
			// 			$('#gprice_txt').html('￥'+json.price);
			// 		},
			// 		//调用执行后调用的函数
			// 		complete: function(XMLHttpRequest, textStatus){
					   
			// 		},
			// 		error: function(){
			// 		}         
			// 	 });
			// }
			//返回按钮
			$('#proDetailTop .top1 .back').on('tap',function(){
				location.href = "<?php echo U('Search/index');?>";
				//window.history.go(-1);
			});
			//当前界面
			//当购物车的数量超过99，则显示99+
			var cartProNum=$('#proDetailTop .top1 a.right em').text();
			if(cartProNum>99){
				$('#proDetailTop .top1 a.right em').text('99+');
			}

			//点击分享 弹出分享框
			$('#proDetailTop .top1 .sharea').on('click',function(){
				$('#share').css('display','block');
			});
			//点击#share区域
			$('#share').on('click',function(){
				$('#share').css('display','none');
			});

			//点击分享框中的取消
			$('#proDetailShare button').on('tap',function(){
				$('#proDetailShare').css('display','none');
			});

			//点击收藏
			var shoucangokTimer=null;
			var shoucangxTimer=null;
			$('#proDetailTop .top1 .shoucanga').on('tap',function(){
				if(is_login==0)
				{
					//window.location.href='/Member/Login?href=<?php echo ($info["id"]); ?>';
					window.location.href = "<?php echo U('/Member/Login/index');?>";
				}
				else
				{
					$.ajax({
						//提交数据的类型 POST GET
						type:"POST",
						//提交的网址
						url:"<?php echo U('Product/addcollection');?>",
						//提交的数据
						data:{'product_id':product_id},
						//返回数据的格式
						datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
						//在请求之前调用的函数
						//成功返回之后调用的函数             
						success:function(json){
							if(json.status<1)
							{
								$.toast(json.info,'cancel', function() {
								});
							}
							else
							{
								$.toast(json.info, function() {
									/*var cstr=$(".td03").html();
									if(cstr.indexOf("cur")>=0){
									}*/
									$('.collect_btn').toggleClass("cur");
								});
							}
						}   ,  
					 });
					var okValue=$(this).find('.shoucangok').css('display');
					if(okValue=='none'){
						//添加收藏
						$(this).find('.shoucangok').css('display','block');
						$(this).find('.shoucang').css('display','none');
						//弹出收藏成功提示 1s后消失
						$('#shoucangokTip').animate({'opacity':1},500,'ease',function(){
							shoucangokTimer=setTimeout(function(){
								shoucangokTimer=null;
								$('#shoucangokTip').animate({'opacity':0},500,'ease');
							},500)
						});
					}else{
						//取消收藏
						$(this).find('.shoucangok').css('display','none');
						$(this).find('.shoucang').css('display','block');
						//弹出取消收藏成功提示 1s后消失
						$('#shoucangxTip').animate({'opacity':1},500,'ease',function(){
							shoucangxTimer=setTimeout(function(){
								shoucangxTimer=null;
								$('#shoucangxTip').animate({'opacity':0},500,'ease');
							},500)
						});
					}
				}
			});

			//电话号码处理成，带有*****
			function telCenterStar(selectorstr){
				var alltel=$(selectorstr);
				for(var i=0;i<alltel.length;i++){
					var str=alltel[i].innerHTML;
					var reg=/(\d{3})(\d{5})(\d{3})/;
					alltel[i].innerHTML=str.replace(reg,'$1*****$3');
				}
			}
			telCenterStar('#proDetailMain .pingjia .main .pingjiaCom .title .phone');

			//规格
			//初始化
			var getSelectNum=$('#proDetailMain .basicInfo .infoContent .select span.num')[0].innerHTML;
			if(getSelectNum>1){
				$('#proDetailGuige .num .addJianCom input').val(getSelectNum);
			}else{
				$('#proDetailGuige .num .addJianCom input').val(1);
			}
			$('#proDetailGuige .num .addJianCom .jian')[0].className='hz jian nooperate';
			$('#proDetailGuige .num .addJianCom .add')[0].className='hz add canoperate';
			//点击+
			$('#proDetailGuige .num .addJianCom .add').on('click',function(){
				var kucun=9999;//从后台获取的库存
				var currNum=$('#proDetailGuige .num .addJianCom input').val();
				currNum++;
				if(currNum>kucun){currNum=kucun;}
				$('#proDetailGuige .num .addJianCom input').val(currNum);
				//更新到基本信息界面上
				$('#proDetailMain .basicInfo .infoContent .select .selectno').css('display','none');
				$('#proDetailMain .basicInfo .infoContent .select .selected').css('display','block');
				$('#proDetailMain .basicInfo .infoContent .select span.num').text(currNum);//件数跟随改变
			});
			//点击-
			$('#proDetailGuige .num .addJianCom .jian').on('click',function(){
				var currNum=$('#proDetailGuige .num .addJianCom input').val();
				currNum--;
				if(currNum<1){currNum=1;}
				$('#proDetailGuige .num .addJianCom input').val(currNum);
				//更新到基本信息界面上
				$('#proDetailMain .basicInfo .infoContent .select .selectno').css('display','none');
				$('#proDetailMain .basicInfo .infoContent .select .selected').css('display','block');
				$('#proDetailMain .basicInfo .infoContent .select span.num').text(currNum);//件数跟随改变
			});
			//手动输入商品数量
			$('.addJianCom input').on('change',function(){
				var v=$(this).val();
				if(v<=0){
					tipFun('低于商品下限');
					$(this).val(1);
				}
				if(v>9999){
					tipFun('超过商品上限');
					$(this).val(1);
				}
			});
			//点击x
			$('#proDetailGuige .top .close').on('click',function(){
				$('#proDetailGuige').css('display','none');
				$('#zhezhao').hide();
			});
			//选中的分类项
			$('#proDetailGuige .fenlei .content p').on('click',function(){
				$(this).addClass('select').siblings().removeClass('select');
				//更新到基本信息界面上
				$('#proDetailMain .basicInfo .infoContent .select .selectno').css('display','none');
				$('#proDetailMain .basicInfo .infoContent .select .selected').css('display','block');
				var alltype=$('#proDetailGuige .fenlei .content');
				var text='';
				for(var i=0;i<alltype.length;i++){
					text+=''+$(alltype[i]).find('.select').text()+' ';
				}
				$('#proDetailMain .basicInfo .infoContent .select span.selectinfo').text(text);//颜色等跟随改变
				//防止同一个元素绑定click冲突
				ergodic();
				// getpriceattr();
			});

			//基本信息
			//轮播
			//设置轮播高度660*525
			setLunboH();
			function setLunboH(){
				var w=$('#proDetailMain .basicInfo .lunbo .swiper-slide img').width();
				$('#proDetailMain .basicInfo .lunbo .swiper-slide img').height(525*w/660);
			}
			var lunbosw = new Swiper('#proDetailMain .basicInfo .lunbo', {
				autoplay: 3000,
				loop:true,
				autoplayDisableOnInteraction:false,
				pagination : '.swiper-pagination',
				paginationType : 'fraction'
			});

			//点击规格
			$('#proDetailMain .basicInfo .infoContent .select').on('tap',function(){
				$('#proDetailGuige').css('display','block');
			});

			var price = <?php echo ($info["gprice"]); ?>;
			//点击加入购物车 选择规格显示
			$('#proDetailBot .cart').on('tap',function(){
				if(price<=0){
					tipFun('商品价格为0，不可购买');return;
				}
				$('#zhezhao').show();
				if($("#proDetailGuige").css("display")=='block')
				{
					addcart(1);
				}
				else
				{
					ergodic();
					// getpriceattr();
					$('#proDetailGuige').css('display','block');
				}
			});

			//点击立即购买 选择规格显示
			$('#proDetailBot .mai').on('tap',function(){
				if(price<=0){
					tipFun('商品价格为0，不可购买');return;
				}
				$('#zhezhao').show();
				if($("#proDetailGuige").css("display")=='block')
				{
					addcart(2);
				}
				else
				{
					ergodic();
					// getpriceattr();
					$('#proDetailGuige').css('display','block');
				}
			});


var is_login=<?php echo ($is_login); ?>;
function addcart(type)
{
	if(is_login==0)
	{
		//window.location.href='/Member/Login?href=<?php echo ($info["id"]); ?>';
		window.location.href = "<?php echo U('/Member/Login/index');?>";
	}
	else
	{
			$.ajax({
				//提交数据的类型 POST GET
				type:"POST",
				//提交的网址
				url:"<?php echo U('Cart/insert');?>",
				//提交的数据
				data:{'amount':$("#amount").val(),'attr':$('#sel_attr').val(),'product_id':product_id,'share_user_id':share_user_id},
				//返回数据的格式
				datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
				//在请求之前调用的函数
				//成功返回之后调用的函数             
				success:function(json){
					if(json.status<1)
					{
						tipFun(json.info);
					}
					else
					{
						if(type==2)
						{
							//立即购买
							window.location.href = "<?php echo U('Cart/step2');?>&cart_id="+json.info;
						}
						else
						{
							//加入购物车
							$('.confirm .top').text('加入购物车成功,是否立即前往?');
							$('#zhezhao').css('display','block');
							$('.confirm').css('display','block');
							$('#proDetailGuige').hide();
							//点击取消
							$('.confirm .bot div.l').on('click',function(){
								$('#zhezhao').css('display','none');
								$('.confirm').css('display','none');
							});
							//点击确定
							$('.confirm .bot div.r').on('click',function(){
								window.location.href='<?php echo U('Cart/index');?>';
							});
						}
						
						/*if($(".pro_num .gmbtn").attr("data-zt")=='立即购买')
						{
							window.location.href='<?php echo U('Cart/index');?>';
						}
						else
						{
							$('.confirm .top').text('加入购物车成功,是否立即前往?');
							$('#zhezhao').css('display','block');
							$('.confirm').css('display','block');
							$('#proDetailGuige').hide();
							//点击取消
							$('.confirm .bot div.l').on('click',function(){
								$('#zhezhao').css('display','none');
								$('.confirm').css('display','none');
							});
							//点击确定
							$('.confirm .bot div.r').on('click',function(){
								window.location.href='<?php echo U('Cart/index');?>';
							});
						}*/
					}
				}      
			 });
	}
	//$.toptip($('#sel_attr').val(),'success');
}
function collection(product_id)
{
	if(is_login==0)
	{
		window.location.href='/Member/Login?href=<?php echo ($info["id"]); ?>';
	}
	else
	{
		$.ajax({
				//提交数据的类型 POST GET
				type:"POST",
				//提交的网址
				url:"<?php echo U('Product/addcollection');?>",
				//提交的数据
				data:{'product_id':product_id},
				//返回数据的格式
				datatype: "json",//"xml", "html", "script", "json", "jsonp", "text".
				//在请求之前调用的函数
				//成功返回之后调用的函数             
				success:function(json){
					if(json.status<1)
					{
						$.toast(json.info,'cancel', function() {
						});
					}
					else
					{
						$.toast(json.info, function() {
							/*var cstr=$(".td03").html();
							if(cstr.indexOf("cur")>=0){
							}*/
							$('.collect_btn').toggleClass("cur");
						});
					}
				}
			 });
	}
}
			//点击nav li切换当前状态
			$('#proDetailTop .top2 li').on('click',function(){
				var index=$(this).index();
				currPage=index;

				$(this).addClass('active').siblings().removeClass('active');
				$('#proDetailMain .contain > div').eq(currPage).css('display','block').siblings().css('display','none');
				onload();
			});


			//评价
			//当评价里面的数量超过999，则显示999+
			var pingjiaSum=$('#proDetailMain .pingjia .top .all').text();
			var pingjiaGood=$('#proDetailMain .pingjia .top .good').text();
			var pingjiaBad=$('#proDetailMain .pingjia .top .bad').text();
			if(pingjiaSum>999){
				$('#proDetailMain .pingjia .top .all').text('999+');
			}
			if(pingjiaGood>999){
				$('#proDetailMain .pingjia .top .good').text('999+');
			}
			if(pingjiaBad>999){
				$('#proDetailMain .pingjia .top .bad').text('999+');
			}

			//切换评论 好评 差评
			$('#proDetailMain .pingjia .top li').on('click',function(){
				var currIndex=$(this).index();
				currPagePj=currIndex;

				$(this).addClass('active').siblings().removeClass('active');
				$('#proDetailMain .four .main .contain > div').eq(currPagePj).css('display','block').siblings().css('display','none');
				onload();
			});

			//tip
			function tipFun(str){
				$('.tip').text(str).css({
					'opacity':'1',
					'z-index':'9999'
				});
				setTimeout(function(){
					$('.tip').css('opacity','0');
					setTimeout(function(){
						$('.tip').css('z-index','-1');
					},300);
				},1300);
			}
		</script>
		<script type="text/javascript">
			wx.config({
			      debug: false,
			      appId: '<?php echo $signPackage["appId"];?>',
			      timestamp: <?php echo $signPackage["timestamp"];?>,
			      nonceStr: '<?php echo $signPackage["nonceStr"];?>',
			      signature: '<?php echo $signPackage["signature"];?>',
			      jsApiList: [
			        'checkJsApi',
			        'onMenuShareTimeline',
			        'onMenuShareAppMessage',
			        'onMenuShareQQ',
			        'onMenuShareWeibo',
			        'onMenuShareQZone',
			      ]
			  });
			
			wx.ready(function(){
				var weiurl = "<?php echo ($weiurl); ?>";
				var weilink = window.location.href;
				var weititle = "<?php echo ($info["title"]); ?>";
				var imgurl = "<?php echo C('WEBSITE'); echo ($info["image"]); ?>";
				var brief = "<?php echo ($info["title"]); ?>";
				//console.log(weiurl);
		      wx.checkJsApi({
		          jsApiList: ['onMenuShareAppMessage'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
		      });
		       wx.onMenuShareTimeline({
		          title: weititle, 
		          link: weiurl,
		          desc: brief,
		          imgUrl: imgurl, // 分享图标
		          trigger:function(res){
		          },
		          success: function () {
		              //alert('已分享');
		          },
		          cancel: function () {
		          },
		          fail:function(){
		          } 
		      });
		      wx.onMenuShareAppMessage({
		          title: weititle, // 分享标题
		          desc: brief, // 分享描述
		          link: weiurl, // 分享链接
		          imgUrl: imgurl, // 分享图标
		          type: 'link', // 分享类型,music、video或link，不填默认为link
		          dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
		          success: function () {
		            //  alert('hello');
		          },
		          cancel: function () {
		          }
		      });
		       //分享到QQ
		      wx.onMenuShareQQ({
		          title: weititle,
		          desc: brief,
		          link: weiurl,
		          imgUrl: imgurl, // 分享图标
		          success: function () { 
		             // 用户确认分享后执行的回调函数
		          },
		          cancel: function () { 
		             // 用户取消分享后执行的回调函数
		          }
		      });
		      //分享到腾讯微博
		      wx.onMenuShareWeibo({
		          title: weititle,
		          desc: brief,
		          link: weiurl,
		          imgUrl: imgurl, // 分享图标
		          success: function () { 
		             // 用户确认分享后执行的回调函数
		          },
		          cancel: function () { 
		              // 用户取消分享后执行的回调函数
		          }
		      });
		
		      // 分享到qq空间
		      wx.onMenuShareQZone({
				    title: weititle, // 分享标题
				    desc: brief, // 分享描述
				    link: weiurl, // 分享链接
				    imgUrl: imgurl, // 分享图标
				    success: function () { 
				       // 用户确认分享后执行的回调函数
				    },
				    cancel: function () { 
				        // 用户取消分享后执行的回调函数
				    }
				});
			});
		</script>
	</body>
</html>